<?php
/**
 * This file is form http://findcat.cn
 *
 * @link     https://findcat.cn
 * @email    1476982312@qq.com
 */
use Illuminate\Support\Facades\Schema;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Database\Migrations\Migration;

class CreateArticlesTable extends Migration
{
    /**
     * Run the migrations.
     */
    public function up()
    {
        Schema::create('articles', function (Blueprint $table) {
            $table->bigIncrements('id');
            $table->boolean('categories_id')->comment('分类id');
            $table->string('title')->comment('标题');
            $table->unsignedBigInteger('admin_user_id')->comment('作者');
            $table->mediumText('content')->comment('文章内容');
            $table->mediumText('markdown')->comment('文章内容');
            $table->string('description')->nullable()->comment('描述');
            $table->string('keywords')->nullable()->comment('关键词');
            $table->string('cover')->nullable()->comment('封面图');
            $table->boolean('is_top')->default(0)->comment('是否置顶 1是 0否');
            $table->boolean('status')->default(1)->comment('状态 1开启 0关闭');
            $table->unsignedBigInteger('click')->default(0)->comment('点击数');
            $table->timestamps();
        });
    }

    /**
     * Reverse the migrations.
     */
    public function down()
    {
        Schema::dropIfExists('articles');
    }
}
